package com.vernhe.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author VernHe
 * @date 2022年02月26日 14:22
 */
//@Configuration
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {




    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
                .httpBasic()
                // 所有请求都需要验证
                .and().authorizeRequests().antMatchers("/**").authenticated()
                //禁用跨域请求伪造保护
                .and().csrf().disable();
    }
}
